package licode.unisop.authcenter.utils;

import licode.unisop.authcenter.exception.CenterErrorCode;
import licode.unisop.provider.conf.SiAssetState;

/**
 * 检查辅助工具类
 *
 * @author licode
 * @version 1.0
 * @date 2018-05-02 8:03
 */
public class CheckUtil {
    public static void checkState(Integer state) {
        if (null == state) {
            throw CenterErrorCode.ASSET_WRONG_STATE.buildException();
        }
        if (state < SiAssetState.AT_AUDIT || state > SiAssetState.AT_DELETED) {
            throw CenterErrorCode.ASSET_WRONG_STATE.buildException();
        }
    }
}
